home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 5
/
BBS in a Box -Volume V (BBS in a Box) (April 1992).iso
/
Files
/
Prog
/
M
/
MPWGCC (Misc).cpt
/
Tests
/
tak.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-12-11
|
334 b
|
24 lines
|
[
TEXT/MPS
]
/* Tak in C */
#include "defns.h"
main()
{
int starttime = clock();
printf("%d\n", tak(18, 12, 6));
printf("%d/%d seconds\n", clock() - starttime, CLK_TCK);
}
tak(x, y, z)
int x, y, z;
{
if (y >= x) {
return z;
} else {
return (tak(tak(x - 1, y, z),
tak(y - 1, z, x),
tak(z - 1, x, y)));
}
}